#include "floatimage.H"

floatimage converter(6,4);

FILE* fp;

void main(int argc, char *argv[])
{
	fp = fopen("ShallowWeight.txt","rt");


	float weightR[4];
	float weightG[4];
	float weightB[4];

	for (int i=0;i<6;i++)
	{
		fscanf(fp,"%f %f %f %f\n",&weightR[0],&weightR[1],&weightR[2],&weightR[3]);
		fscanf(fp,"%f %f %f %f\n",&weightG[0],&weightG[1],&weightG[2],&weightG[3]);
		fscanf(fp,"%f %f %f %f\n",&weightB[0],&weightB[1],&weightB[2],&weightB[3]);

		for (int j=0;j<4;j++)
		{
			converter.point(i,j).r=weightR[j];
			converter.point(i,j).g=weightG[j];
			converter.point(i,j).b=weightB[j];

		}

	}

	for (int i=0;i<6;i++)
	{
		for (int j=0;j<4;j++)
		{
			printf("%f %f %f \n",converter.point(i,j).r,converter.point(i,j).g,converter.point(i,j).b);
		}
	}

	/*for (int i=0;i<10;i++)
	{
	for (int j=0;j<10;j++)
	{
	converter.point(i,j).r=j/10.0;
	converter.point(i,j).g=0;
	converter.point(i,j).b=0;
	}
	}*/

	converter.SavePFM("ShallowWeight.pfm");
}